package hamsterpolice.todo.model;

import hamsterpolice.todo.data.Criteria;

public class AuthenticationCriteria extends Criteria<String[]>{
	
	public AuthenticationCriteria(String username, String passwordHash){
		this(new String[]{username, passwordHash});
	}

	public AuthenticationCriteria(String[] value) {
		super(value);
		
		if(value==null || value.length != 2)
			throw new IllegalArgumentException("Parameter value must be a 2-element array containing username and hashed password");
	}
	
	public String getUsername(){
		return getValue()[0];
	}
	
	public String getPasswordHash(){
		return getValue()[1];
	}
}